import pytest,os
from common.config import CASE_PATH,RAW_PATH,HTML_PATH
from common.com import date,shu_til
from time import sleep
from common.dingding import dingding


if __name__ == '__main__':
    day =date('%Y-%m-%d')
    # 生成测试报告json
    pytest.main(['-v', '-s', CASE_PATH,'--alluredir', RAW_PATH + day + '/'])
    # 将测试报告转为html格式
    split = 'allure ' + 'generate ' + RAW_PATH + day + '/ ' + '-o ' + HTML_PATH + day + '/ ' + ' --clean'

    # os.system(split)#执行命令
    # sleep(1)
    # shu_til(RAW_PATH + day)#删除非空目录
    # sleep(5)
    # dingding().inform()#发送钉钉


